<template>
    <div class="profile">
        <UserCard></UserCard>
        <TradePageGroup></TradePageGroup>
        <Settings></Settings>
        <DownloadApp></DownloadApp>
    </div>
</template>

<script setup>
import UserCard from '@/components/pageunit/asset/UserCard.vue';
import TradePageGroup from '@/components/pageunit/trade/TradePageGroup.vue';
import Settings from '@/components/pageunit/system/Settings.vue';
import DownloadApp from '@/components/pageunit/system/DownloadApp.vue';
import { onMounted, onActivated } from 'vue';
import { depositService } from '@/service/deposit';
import { userService, is_sumbit, user_auth_status } from '@/service/user';
import { is_login } from '@/service/auth';
import { routerTo } from '@/utils/jump';
import { loading } from '@/service/status';

onMounted(async () => {
    // loading.value = true;
    await userService.getUserInfo();
    // loading.value = false;
    if (is_login.value == false) {
        routerTo('/login');
    }
    await userService.getAuthInfo((data) => {
        console.log('请求成功', data);
        is_sumbit.value = true;
        user_auth_status.value = data.status;
    }, (res) => {
        console.log('请求失败', res);
    });
    depositService.getDepositList();
    depositService.getWithdrawList();
});

// onActivated(() => {
//     console.log('111111111111111');
//     userService.getUserInfo();
// });
</script>

<style scoped lang="less">
.profile {
    --gap: 3.5vw;
    padding: var(--gap);
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}
</style>